#define  _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
#include<stack>
#include<queue>
int main() {

	return 0;
}

class Solution {
public:
    bool IsPopOrder(vector<int>& pushV, vector<int>& popV) {
		if (pushV.size()!=popV.size())
		{
			return false;
		}
		stack<int> s;
		int pushi = 0;
		int popi = 0;
		while (pushi<pushV.size())
		{
			s.push(pushV[pushi]);
			while (!s.empty()&&s.top()==popV[popi])
			{
				s.pop();
				popi++;
			}
			pushi++;
		}
		if (!s.empty())
		{
			return false;
		}
		return true;
    }
};

class Solution {
public:
    int evalRPN(vector<string>& tokens) {
        stack<int> s;
        for (auto& ch : tokens)
        {
            if (ch == "+" || ch == "-" || ch == "*" || ch == "/")
            {
                int right = s.top();
                s.pop();
                int left = s.top();
                s.pop();
                switch (ch[0])
                {
                case '+':
                    s.push(left + right);
                    break;
                case '-':
                    s.push(left - right);
                    break;
                case '*':
                    s.push(left * right);
                    break;
                case '/':
                    s.push(left / right);
                    break;
                }
            }
            else {
                s.push(stoi(ch));
            }
        }
        return s.top();

    }
};